# Contributor: G.J.R. Timmer <gjr.timmer@gmail.com>
# Maintainer: G.J.R. Timmer <gjr.timmer@gmail.com>
pkgname=postgresql-pg_cron
pkgver=1.6.2
pkgrel=0
pkgdesc="Cron-based scheduler for PostgreSQL 9.5+"
url="https://github.com/citusdata/pg_cron"
arch="all"
license="PostgreSQL"
makedepends="postgresql-dev"
provides="pg_cron=$pkgver-r$pkgrel"
install="$pkgname.post-install"
source="https://github.com/citusdata/pg_cron/archive/v$pkgver/pg_cron-$pkgver.tar.gz"
builddir="$srcdir/pg_cron-$pkgver"
options="!check"  # no tests provided

prepare() {
	default_prepare
	# Remove -Werror from Makefile
	# Required to compile on alpine, to ignore compilation warnings
	sed "s/-Werror //" -i Makefile
}

build() {
	make
}

package() {
	depends="postgresql$(pg_config --major-version)"

	make DESTDIR="$pkgdir" install
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
4202f0a35c07d090be817284ff518d97e31ea9860c0e0b0ac9657539b1e5695a03246faa9c2bb793abdf2b971ec0792732fcf43b06bb94537272a613e6bd91ba  pg_cron-1.6.2.tar.gz
"
